CREATE TABLE DataTaxonomy
(
	PK_ID int identity not null primary key,
	FK_ParentID int not null,
	[Name] nvarchar(100) not null
);
[GO]

CREATE TABLE ContentTaxonomy
(
	PK_ID int identity not null primary key,
	FK_ContentID int not null,
	FK_DataTaxonomyID int
);
[GO]

CREATE TABLE Content
(
	PK_ID int identity not null primary key,
	FK_ParentID int not null,
	Rank int not null,
	FK_STypeID nvarchar(250) not null,
	NodeTitle nvarchar(500) not null,
	NodeName nvarchar(100) not null,
	NodePath nvarchar(4000) not null,
	CreatedDT datetime not null,
	FK_CreatedBy int not null,
	LastModifiedDT datetime not null,
	FK_LastModifiedBy int not null,
	WorkflowModeID int not null,
	WorkflowStatus int not null,
	FK_CheckedOutTo int not null,
	CheckedOutDT datetime not null,
	CurrentVersionNumber int not null,
	HasEmbargoStart bit not null,
	PublishStartDT datetime not null,
	HasEmbargoEnd bit not null,
	PublishUntilDT datetime not null,
	ExpiryActionID int not null,
	ExpiryActionDataID int not null,
	HasOwnSecurity bit not null,
	FK_LiveV int not null,
	FK_VersionV int not null
);
[GO]

CREATE TABLE ContentV
(
	PK_ID int identity not null primary key,
	FK_ContentID int not null,
	VersionNumber int not null,
	FK_CheckedInBy int not null,
	CheckedInDT datetime not null,
	VersionNotes ntext,
	XMLData xml
);
[GO]

CREATE TABLE ContentWorkflow
(
	PK_ID int identity not null primary key,
	FK_ContentID int not null,
	FK_DefinitionID int not null,
	FK_GroupID int not null
	
);
[GO]

CREATE TABLE ContentSecurity
(
	PK_ID int identity not null primary key,
	FK_ContentID int not null,
	FK_GroupID int not null,
	ContentActionID int not null
);
[GO]

CREATE TABLE ContentPortlets
(
	PK_ID int identity not null primary key,
	FK_ContentID int not null,
	ZoneID nvarchar(100) not null,
	FK_SPortletID nvarchar(250) not null,
	XMLData xml
);
[GO]

CREATE TABLE ContentDomainMapping
(
	PK_ID int identity not null primary key,
	Domain nvarchar(500) not null,
	FK_Homepage int not null,
	FK_Rootpage int not null
);
[GO]

